<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改面试评价')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-interview-edit" th:object="${bizInterviewEvaluationInfo}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">应聘者姓名：</label>
                <div class="col-sm-8">
                    <input name="interviewerName" th:field="*{interviewerName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">性别 ：</label>
                <div class="col-sm-8">
                    <select name="sex" class="form-control m-b">
                        <option value="0">女生</option>
                        <option value="1"> 男生</option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">年龄：</label>
                <div class="col-sm-8">
                    <input name="age" th:field="*{age}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">岗位：</label>
                <div class="col-sm-8">
                    <input name="postId" th:field="*{postId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">所属部门：</label>
                <div class="col-sm-8">
                    <input name="department" th:field="*{department}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">毕业信息：</label>
                <div class="col-sm-8">
                    <input name="graduationInfo" th:field="*{graduationInfo}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">学历：</label>
                <div class="col-sm-8">
                    <input name="education" th:field="*{education}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">应聘时间：</label>
                <div class="col-sm-8">
                    <input name="interviewTime" th:field="*{interviewTime}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">面试评价id：</label>
                <div class="col-sm-8">
                    <input name="interviewId" th:field="*{interviewId}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">求职动机评价结论：</label>
                <div class="col-sm-8">
                    <input name="factorOneResult" th:field="*{factorOneResult}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">求职动机简要说明：</label>
                <div class="col-sm-8">
                    <input name="factorOneExplain" th:field="*{factorOneExplain}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">仪表、仪态评价结论：</label>
                <div class="col-sm-8">
                    <input name="factorTwoResult" th:field="*{factorTwoResult}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">仪表、仪态简要说明：</label>
                <div class="col-sm-8">
                    <input name="factorTwoExplain" th:field="*{factorTwoExplain}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">工资待遇、工作条件、满足程度评价结果：</label>
                <div class="col-sm-8">
                    <input name="factorThreeResult" th:field="*{factorThreeResult}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">口头表达能力、沟通能力、反应能力评价结论：</label>
                <div class="col-sm-8">
                    <input name="factorFourResult" th:field="*{factorFourResult}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">工作经验与应聘职位的关联程度评价结论：</label>
                <div class="col-sm-8">
                    <input name="factorFiveResult" th:field="*{factorFiveResult}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">学历、工作经历评价结论：</label>
                <div class="col-sm-8">
                    <input name="factorSixResult" th:field="*{factorSixResult}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">工资待遇、工作条件、满足程度简要说明：</label>
                <div class="col-sm-8">
                    <input name="factorThreeExplain" th:field="*{factorThreeExplain}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">口头表达能力、沟通能力、反应能力简要说明：</label>
                <div class="col-sm-8">
                    <input name="factorFourExplain" th:field="*{factorFourExplain}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">工作经验与应聘职位的关联程度简要说明：</label>
                <div class="col-sm-8">
                    <input name="factorFiveExplain" th:field="*{factorFiveExplain}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">学历、工作经历简要说明：</label>
                <div class="col-sm-8">
                    <input name="factorSixExplain" th:field="*{factorSixExplain}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js" />
    <script th:src="@{/js/activiti.js}"></script>
    <script th:inline="javascript">
        var prefix = ctx + "interview";
        $("#form-interview-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form() && validateStartTimeAndEndTime()) {
                $.operate.save(prefix + "/edit", $('#form-interview-edit').serialize());
            }
        }

        $("input[name='startTime']").datetimepicker({
            autoclose: true,
            startDate: new Date()
        });

        $("input[name='endTime']").datetimepicker({
            autoclose: true,
            startDate: new Date()
        });

        // 监听开始和结束日期填写，动态生成请假时长
        $('.calcTotalSecondInput').change(function () {
            if (!$('input[name="startTime"]').val() || !$('input[name="endTime"]').val()) {
                return;
            }
            if (validateStartTimeAndEndTime()) {
                var totalSecond = calcTotalSecond($('input[name="startTime"]').val(), $('input[name="endTime"]').val());
                $('input[name="totalTime"]').val(totalSecond);
                var dateSub = formatTotalDateSub(totalSecond);
                $('input[name="totalTimeText"]').val(dateSub);
            }
        });

        $(function () {
            var leave = [[${bizLeave}]];
            var dateSub = formatTotalDateSub(leave.totalTime);
            $('input[name="totalTimeText"]').val(dateSub);
        });

        function validateStartTimeAndEndTime() {
            if ($('input[name="startTime"]').val() >= $('input[name="endTime"]').val()) {
                $.modal.alertWarning("结束时间必须大于开始时间");
                return false;
            }
            return true;
        }
    </script>
</body>
</html>
